<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>首页</title>
  
  <!--引入 element-ui 的样式，-->
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <!-- 必须先引入vue，  后使用element-ui -->
  <script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"></script>
  <!-- 引入element 的组件库-->
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@4/dist/echarts.min.js"></script>
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-gl@1/dist/echarts-gl.min.js"></script>
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-stat@1/dist/ecStat.min.js"></script>
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@4/dist/extension/dataTool.min.js"></script>
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@4/map/js/china.js"></script>
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@4/map/js/world.js"></script>
  <!--<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=xfhhaTThl11qYVrqLZii6w8qE5ggnhrY&__ec_v__=20190126"></script>-->
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@4/dist/extension/bmap.min.js"></script>
</head>
<body>
<div id="app">
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <span>金融统计</span>
    </div>
    <div class="text item">
      <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
      <div id="container" style="width: 1200px;height:650px;"></div>
      <!--<div id="main" style="width: 800px;height:450px;"></div>-->
    </div>
  </el-card>
</div>
</body>
<script>
  new Vue({
    el: '#app',
    name: 'AdminMain'
  });
</script>
<!--<script>-->

    <!--// 基于准备好的dom，初始化echarts实例-->
    <!--var myChart = echarts.init(document.getElementById('container'));-->
    <!--var myChart = echarts.init(dom,'light');-->
    <!--option = {-->
        <!--legend: {},-->
        <!--title: {-->
            <!--text: '用户投资详情',-->
            <!--subtext: '#金融表单'-->
        <!--},-->
        <!--tooltip: {-->
            <!--trigger: 'axis',-->
            <!--showContent: false-->
        <!--},-->
        <!--toolbox: {-->
            <!--feature: {-->
                <!--dataView: {show: true, readOnly: false},-->
                <!--magicType: {show: true, type: ['line', 'bar']},-->
                <!--restore: {show: true},-->
                <!--saveAsImage: {show: true}-->
            <!--}-->
        <!--},-->
        <!--dataset: {-->
            <!--source: [-->
                <!--['product', '2012', '2013', '2014', '2015', '2016', '2017'],-->
                <!--['零钱理财', 41.1, 30.4, 65.1, 53.3, 83.8, 98.7],-->
                <!--['工资理财', 86.5, 92.1, 85.7, 83.1, 73.4, 55.1],-->
                <!--['期货理财', 24.1, 67.2, 79.5, 86.4, 65.2, 82.5],-->
                <!--['基金理财', 55.2, 67.1, 69.2, 72.4, 53.9, 39.1]-->
            <!--]-->
        <!--},-->
        <!--xAxis: {type: 'category'},-->
        <!--yAxis: {gridIndex: 0},-->
        <!--grid: {top: '55%'},-->
        <!--series: [-->
            <!--{type: 'line', smooth: true, seriesLayoutBy: 'row'},-->
            <!--{type: 'line', smooth: true, seriesLayoutBy: 'row'},-->
            <!--{type: 'line', smooth: true, seriesLayoutBy: 'row'},-->
            <!--{type: 'line', smooth: true, seriesLayoutBy: 'row'},-->
            <!--{-->
                <!--type: 'pie',-->
                <!--id: 'pie',-->
                <!--radius: '30%',-->
                <!--center: ['50%', '25%'],-->
                <!--label: {-->
                    <!--formatter: '{b}: {@2012} ({d}%)'-->
                <!--},-->
                <!--encode: {-->
                    <!--itemName: 'product',-->
                    <!--value: '2012',-->
                    <!--tooltip: '2012'-->
                <!--}-->
            <!--}-->
        <!--]-->
    <!--};-->

    <!--myChart.on('updateAxisPointer', function (event) {-->
        <!--var xAxisInfo = event.axesInfo[0];-->
        <!--if (xAxisInfo) {-->
            <!--var dimension = xAxisInfo.value + 1;-->
            <!--myChart.setOption({-->
                <!--series: {-->
                    <!--id: 'pie',-->
                    <!--label: {-->
                        <!--formatter: '{b}: {@[' + dimension + ']} ({d}%)'-->
                    <!--},-->
                    <!--encode: {-->
                        <!--value: dimension,-->
                        <!--tooltip: dimension-->
                    <!--}-->
                <!--}-->
            <!--});-->
        <!--}-->
    <!--});-->

    <!--myChart.setOption(option);-->
<!--</script>-->
<script type="text/javascript">
    var dom = document.getElementById("container");
    var myChart = echarts.init(dom,'light');
    var app = {};
    option = null;

    setTimeout(function () {

        option = {
            legend: {},
            title: {
                text: '用户投资详情',
                subtext: '#金融表单'
            },
            tooltip: {
                trigger: 'axis',
                // showContent: false,
                axisPointer: {
                    type: 'cross',
                    //xy轴十字架指示数值背景区域色
                    label: {
                        backgroundColor: '#6a7985'
                    }
                }
            },
            textStyle: {
                color: '#466293'
            },
            toolbox: {
                feature: {
                    dataView: {show: true, readOnly: false},
                    magicType: {show: true, type: ['line', 'bar']},
                    restore: {show: true},
                    saveAsImage: {show: true}
                }
            },
            dataset: {
                source: [
                    ['product', '2017-3', '2017-6', '2017-9', '2017-12', '2018-3', '2018-6', '2018-9', '2018-12', '2019-3', '2019-6', '2019-9', '2019-12', '2020-3', '2020-6', '2020-9', '2020-12'],
                    ['零钱理财', 41.1, 30.4, 65.1, 53.3, 73.8, 78.7, 83.1, 73.4, 85.7, 83.1, 82.5, 67.2, 79.5, 81.7, 87.5, 79.8],
                    ['工资理财', 86.5, 92.1, 85.7, 83.1, 73.4, 55.1, 72.4, 53.9, 83.1, 73.4, 67.1, 69.2, 72.4, 53.9, 55.2, 60.8],
                    ['期货理财', 24.1, 67.2, 79.5, 86.4, 65.2, 82.5, 67.2, 79.5, 83.8, 98.7, 99.4, 97.9, 90.3, 94.6, 85.2, 89.9],
                    ['基金理财', 55.2, 67.1, 69.2, 72.4, 53.9, 39.1, 24.1, 67.2, 69.5, 69.2, 72.5, 76.6, 81.2, 79.0, 73.2, 66.6]
                ]
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
            },
            yAxis: {gridIndex: 0},
            dataZoom: [
                {   // 这个dataZoom组件，默认控制x轴。
                    type: 'slider', // 这个 dataZoom 组件是 slider 型 dataZoom 组件
                    start: 0,      // 左边在 10% 的位置。
                    end: 60         // 右边在 60% 的位置。
                }
            ],
            grid: {top: '55%'},
            series: [
                {type: 'line', smooth: true, seriesLayoutBy: 'row',areaStyle: {}},
                {type: 'line', smooth: true, seriesLayoutBy: 'row',areaStyle: {}},
                {type: 'line', smooth: true, seriesLayoutBy: 'row',areaStyle: {}},
                {type: 'line', smooth: true, seriesLayoutBy: 'row',areaStyle: {}},
                {
                    type: 'pie',
                    id: 'pie',
                    radius: '30%',
                    center: ['50%', '25%'],
                    label: {
                        formatter: '{b}: {@2012} ({d}%)'
                    },
                    encode: {
                        itemName: 'product',
                        value: '2012',
                        tooltip: '2012'
                    }
                }
            ]
        };

        myChart.on('updateAxisPointer', function (event) {
            var xAxisInfo = event.axesInfo[0];
            if (xAxisInfo) {
                var dimension = xAxisInfo.value + 1;
                myChart.setOption({
                    series: {
                        id: 'pie',
                        label: {
                            formatter: '{b}: {@[' + dimension + ']} ({d}%)'
                        },
                        encode: {
                            value: dimension,
                            tooltip: dimension
                        }
                    }
                });
            }
        });

        myChart.setOption(option);

    });;
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
</script>
<style type="text/css">
  .text {
    font-size: 14px;
  }
  
  .item {
    margin-bottom: 18px;
  }
  
  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }
  
  .box-card {
    width: 100%;
  }
</style>
</html>